package com.jinxin.platform.cdcardpassmgr.utils;

import com.alibaba.fastjson.JSON;
import org.springframework.util.StringUtils;

import java.util.Map;
import java.util.UUID;

/**
 * All rights Reserved, Designed By www.beonelot.com
 *
 * @version: V1.0
 * @Copyright: www.beonelot.com Inc. All rights reserved.
 * @Description：
 * @Date: 2021-02-24
 * @Author: Lingnan
 **/
public class StringUtil {
    public static String getUuid() {
        UUID uuid = UUID.randomUUID();
        return uuid.toString().replace("-", "");
    }

    public static Map<String,String> jsonToMap(String jsonStr){
        if(StringUtils.isEmpty(jsonStr)){return null;}
        Map<String,String> map = (Map<String, String>) JSON.parse(jsonStr);
        return map;
    }

    public static void main(String[] args) {
//        String str = "{\"0\":\"zhangsan\",\"1\":\"lisi\",\"2\":\"wangwu\",\"3\":\"maliu\"}";
//        System.out.println(jsonToMap(str));
    }
}
